package com.peanut.bosskg.service.other.pay;

import com.alibaba.fastjson.JSON;
import com.peanut.bosskg.entity.ResponseMessageVO;
import com.peanut.bosskg.entity.pay.BatchOrderTransDTO;
import com.peanut.bosskg.entity.pay.BatchPaymentResDTO;
import com.peanut.bosskg.entity.pay.TrialCalculateDTO;
import com.peanut.bosskg.entity.pay.TrialCalculateResVO;
import com.peanut.bosskg.enums.FunCodeEnum;
import com.peanut.bosskg.service.BaseService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * 连续劳务试算
 */
@Service
@Slf4j
public class TrialCalculateService extends BaseService {

    public List<TrialCalculateResVO> doBusiness(FunCodeEnum funCodeEnum, TrialCalculateDTO trialCalculateDTO) throws Exception {
        log.info("试算接口开始:{}，{}", funCodeEnum, trialCalculateDTO);
        ResponseMessageVO responseMessage = applyYouFuByHttpPost(funCodeEnum, trialCalculateDTO);
        List<TrialCalculateResVO> trialCalculateResVOS = JSON.parseArray(responseMessage.getResData(), TrialCalculateResVO.class);
        log.info("试算接口结束:{}", trialCalculateResVOS);
        return trialCalculateResVOS;
    }

}
